package com.cyh.greendaoupgrade;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.cyh.greendaoupgrade.greendao.DBUtils;
import com.cyh.greendaoupgrade.greendao.model.BookItem2;
import com.cyh.greendaoupgrade.greendao.model.StudentItem;
import com.cyh.greendaoupgrade.greendao.model.TeacherItem;
import com.cyh.greendaoupgrade.greendao.model.UserItem;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void addDataToTable(View view) {
        /*for(int i = 0; i < 2; i++) {
            UserItem u = new UserItem(null, "uuid = " + i, "名字" + i);
            StudentItem s = new StudentItem(null, "ssuuid = " + i, "学生" + i);
            DBUtils.getInstance(this).insertUser(u);
            DBUtils.getInstance(this).insertStudent(s);
        }*/

        /*for(int i = 0; i < 2; i++) {
            TeacherItem u = new TeacherItem(null, "老师" + i);
            DBUtils.getInstance(this).insertTeacher(u);
        }*/

        for(int i = 0; i < 2; i++) {
            /*BookItem2 u = new BookItem2(null, "书" + i);
            DBUtils.getInstance(this).insertBook(u);*/
        }
    }
}
